<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Device Details</f:facet>


        <s:decorate id="name" template="layout/display.xhtml">
            <ui:define name="label">Name</ui:define>
            <h:outputText value="#{deviceHome.instance.name}"/>
        </s:decorate>

        <s:decorate id="type" template="layout/display.xhtml">
            <ui:define name="label">Type</ui:define>
            <h:outputText value="#{deviceHome.instance.type}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/DeviceEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty deviceFrom ? 'DeviceList' : deviceFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Device actionses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="deviceActionsesChildren">

        <h:outputText value="There are no deviceActionses associated with this device."
                   rendered="#{empty deviceHome.deviceActionses}"/>

        <rich:dataTable value="#{deviceHome.deviceActionses}"
                       var="_deviceActions"
                  rendered="#{not empty deviceHome.deviceActionses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="deviceActionsesTable">
            <rich:column sortBy="#{_deviceActions.deviceActionsId}">
                <f:facet name="header">Device actions id</f:facet>
                <h:outputText value="#{_deviceActions.deviceActionsId}"/>
            </rich:column>
            <rich:column sortBy="#{_deviceActions.actionType}">
                <f:facet name="header">Action type</f:facet>
                <h:outputText value="#{_deviceActions.actionType}"/>
            </rich:column>
            <rich:column sortBy="#{_deviceActions.name}">
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{_deviceActions.name}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectdeviceActions"
                     value="Select"
                      view="/DeviceActions.xhtml">
                    <f:param name="deviceActionsDeviceActionsId"
                            value="#{_deviceActions.deviceActionsId}"/>
                    <f:param name="deviceActionsFrom" value="Device"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add deviceActions"
                view="/DeviceActionsEdit.xhtml">
            <f:param name="deviceDeviceId"
                    value="#{deviceHome.instance.deviceId}"/>
            <f:param name="deviceActionsFrom" value="Device"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Status actionses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="statusActionsesChildren">

        <h:outputText value="There are no statusActionses associated with this device."
                   rendered="#{empty deviceHome.statusActionses}"/>

        <rich:dataTable value="#{deviceHome.statusActionses}"
                       var="_statusActions"
                  rendered="#{not empty deviceHome.statusActionses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="statusActionsesTable">
            <rich:column sortBy="#{_statusActions.statusActionId}">
                <f:facet name="header">Status action id</f:facet>
                <h:outputText value="#{_statusActions.statusActionId}"/>
            </rich:column>
            <rich:column sortBy="#{_statusActions.statusAction}">
                <f:facet name="header">Status action</f:facet>
                <h:outputText value="#{_statusActions.statusAction}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstatusActions"
                     value="Select"
                      view="/StatusActions.xhtml">
                    <f:param name="statusActionsStatusActionId"
                            value="#{_statusActions.statusActionId}"/>
                    <f:param name="statusActionsFrom" value="Device"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add statusActions"
                view="/StatusActionsEdit.xhtml">
            <f:param name="deviceDeviceId"
                    value="#{deviceHome.instance.deviceId}"/>
            <f:param name="statusActionsFrom" value="Device"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
